﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string xmlPath = AppDomain.CurrentDomain.BaseDirectory + "xmlTest.xml";
            XElement xmlData = XElement.Parse(System.IO.File.ReadAllText(xmlPath));
         

            var unit_test = from unit in xmlData.Descendants("UNIT")
                            select new { CODE = unit.Element("CODE").Value, UNIT = unit.Element("UNIT").Value };

            
            foreach (var item in unit_test)
            {
                Console.WriteLine(item.CODE);  
            }


            Console.ReadLine();
        }


    }
}
